# Filename:    makefile
# Author:      Erik Öjebo
# Date:        2009-01-14
# Description: Makefile for the SCTP project application in the course 
#              "UNIX Network Programming in C"
# Notes:       Uses implicit rules for the compilation of the .o files.

CC=g++
CCFLAGS=-Wall
SERVEROBJS=server.o sctp_connection.o address.o \
         sctp_one_to_many_connection.o sctp_one_to_one_connection.o \
         association_collection.o association_collection_const_iterator.o
CLIENTOBJS=sctp_connection.o sctp_one_to_many_connection.o client.o \
	    association_collection.o association_collection_const_iterator.o \
	    address.o sctp_one_to_one_connection.o 

all: server client

clean:
	rm *.o server client
	touch *

server : $(SERVEROBJS)
	$(CC) $(SERVEROBJS) $(CCFLAGS) -o server -lpthread -lsctp

client : $(CLIENTOBJS)
	$(CC) $(CLIENTOBJS) $(CCFLAGS) -o client -lpthread -lsctp

sctp_connection.o : sctp_connection.cpp sctp_connection.h

sctp_one_to_many_connection.o : sctp_one_to_many_connection.cpp \
                                sctp_one_to_many_connection.h

sctp_one_to_one_connection.o : sctp_one_to_one_connection.cpp \
                               sctp_one_to_one_connection.h

address.o : address.cpp address.h

association_collection.o : association_collection.cpp association_collection.h

association_collection_const_iterator.o : \
        association_collection_const_iterator.cpp \
        association_collection_const_iterator.h
